<template>
  <div>
    <TypeNav></TypeNav>
    <div class="vip-detail" style="marginTop:20px">
    <!-- 主要内容区域 -->
    <section class="con">
      <div class="mainCon">
        <!-- 左侧放大镜 -->
        <div>
          <Zoom :goodsInfo="goodsInfo"></Zoom>
        </div>
        <!-- 右侧商品选择 -->
        <div>
          <Specifications :goodsInfo="goodsInfo"></Specifications>
        </div>
      </div>
      <!-- 底部详情 -->
      <div class="footerDetail">
        <ProductDetail class="product"></ProductDetail>
        <Recommend class="recommend"></Recommend>
      </div>
    </section>
  </div>
  </div>
</template>

<script>
import Zoom from "./Zoom/index.vue";
import Specifications from "./Specifications/index.vue";
import ProductDetail from "./ProductDetails/index.vue";
import Recommend from "./Recommend/index.vue";
import { getGoodsDetailApi } from "@/api/detail";
export default {
  name: "Detail",
  data() {
    return {
      goodsInfo: {},
    };
  },
  mounted() {
    this.getGoodsDetail();
  },
  methods: {
    async getGoodsDetail() {
      const res = await getGoodsDetailApi(this.$route.params.skuId);
      this.goodsInfo = res.data.skuInfo
    },
  },
  components: { Zoom, Specifications, ProductDetail, Recommend },
};
</script>

<style lang="less" scoped>
body {
  margin: 0;
  padding: 0;
  .con {
    width: 1000px;
    // height: 1000px;
    // border: 1px solid green;
    margin: auto;
    .mainCon {
      // border: 1px solid red;
      display: flex;
      justify-content: space-between;
      margin-bottom: 50px;
    }
    .footerDetail {
      // border: 1px solid black;
      position: relative;
      .recommend {
        position: absolute;
        top: 0;
        left: -190px;
      }
    }
  }
}
</style>
